﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Account_Register : System.Web.UI.Page, ICreateUserView
{
    #region Fields
    CreateUserPresenter _presenter;
    #endregion

    #region Properties
    public string UserName
    {
        get { return txtUserName.Text; }
    }

    public string Password
    {
        get { return txtPassword.Text; }
    }

    public string Email
    {
        get { return txtEmail.Text; }
    }
    #endregion

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        this._presenter = new CreateUserPresenter(this);
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {

    }

    protected void CreateUserButton_Click(object sender, EventArgs e)
    {
        this._presenter.CreateUser();
        FormsAuthentication.SetAuthCookie(txtUserName.Text, false /* createPersistentCookie */);
    }


}
